import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LayoutView from '@/views/LayoutView'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'LayoutView',
    component: LayoutView,
    children: [
      {
        path: '/',
        name: 'home',
        component: HomeView
      },
      {
        path: '/topic',
        name: 'Topic',
        component: () => import('../views/TopicView')
      },
      {
        path: '/mine',
        name: 'Mine',
        component: () => import('../views/MineView')
      },
      {
        path: '/search',
        name: 'Search',
        component: () => import('../views/SearchView')
      },
      {
        path: '/details/:id',
        name: 'Details',
        component: () => import('../components/MyList/listDetails')
      },
      {
        path: '/play/:id/:name/:artist/:image',
        name: 'Play',
        component: () => import('../components/MySong/songPlay')
      },
      {
        path: '/radio/:id',
        name: 'Radio',
        component: () => import('../components/MyRadio/radioDetails')
      },
      {
        path: '/radioPlay/:id',
        name: 'RadioPlay',
        component: () => import('../components/MyRadio/radioPlay')
      },
      {
        path: '/info',
        name: 'MyInformation',
        component: () => import('../components/MyHome/myInformation')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes,
  linkActiveClass: 'active'
})

export default router
